package com.rgs.se.design.adapter;

/**
 * @author Ren Gaoshuai
 * @ClassName Headset
 * @Description 耳机 圆孔 听歌 适配者
 * @date 2022-01-22 11:28
 **/
public class Headset {

    public void sign(){
        System.out.println("圆孔使用中，听歌--");
    }

//    public static void main(String[] args) {
////        String str4 = "test";
////        String str2 = new String("test");
////        String str3 = str2.intern();
////
////        System.out.println(str3 == str4);
////        System.out.println(str3 == str2);
//    }

    public static void main(String[] args) {

        //堆中
        String str2 = new String("str")+new String("01");
        String str3 = new String("str01");

        //常量池中
        String str4 = "str01";
        String str5 = "str01";
        System.out.println(str2 ==str4);
        System.out.println(str3 ==str4);
        System.out.println(str4 == str5);
    }
}
